
import os

def printModules(modules):
    print("==== sub-modules list:")
    
    for module in modules:
        print(module)

    print("====")


PROJ_ROOT_PATH = "../.."

ringbufferModulePath = PROJ_ROOT_PATH + "/" + "middleware/ringbuffer"

subModules = []
subModules.append(ringbufferModulePath + "/SConscript")

printModules(subModules)

SConscript(subModules)


srcs = ["main.c"]

env = Environment()

env.Append(CPPPATH = ringbufferModulePath)

env.Append(LIBPATH = ringbufferModulePath)

env.Append(LIBS = ['asound', 'ringbuffer'])

env.Program(target = 'alsa', source = srcs)

# ====

# Program('playback', ['playback.c', 'comm.c'], 
#       LIBS = 'asound')

# Program('capture', 'capture.c', 
#       LIBS = 'asound')
